import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/layout'
  },
  {
    path: '/layout',
    name: 'layout',
    component: () => import('@/views/layout/index.vue'),
    redirect: '/layout/welcome',
    children: [
      { path: 'welcome', name: 'welcome', component: () => import("@/views/layout/pages/welcome.vue") },
      { path: 'designpages', name: 'designpages', component: () => import("@/views/layout/pages/designpages.vue") },
      { path: '404', name: '404', component: () => import('@/views/layout/pages/404.vue') },
      { path: 'renovation',name: 'renovation',component: ()=>import('@/views/layout/pages/renovation/index.vue')}
    ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('@/views/About.vue')
  },
  { path: '/:pathMatch(.*)*', redirect: '/layout/404' },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
